package com.xlabs.client;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * TimedCommentServiceAsync interface.
 */
public interface CommentingServiceAsync {


    /**
     * Posts comment for a video.
     *
     * @param comment        comment text.
     * @param time           time of comment.
     * @param currentVideoId video id.
     */
    void postQuestion(String comment, int time, String currentVideoId, AsyncCallback async);

    /**
     * Gets all comments for the given video.
     *
     * @param currentVideoId video id.
     */
    void getQuestions(String currentVideoId, AsyncCallback async);

    /**
     * Posts a reply for a question.
     *
     * @param reply       reply.
     * @param questionKey question key.
     * @return updated comments.
     */
    void postReply(String reply, String questionKey, AsyncCallback async);

    /**
     * Gets the conversation related to the question given.
     *
     * @param questionEncodedKey question's key.
     * @return conversation.
     */
    void getConversation(String questionEncodedKey, AsyncCallback async);

    /**
     * Posts an inner reply for another reply in conversation.
     *
     * @param reply              reply.
     * @param parentReplyKey     question key.
     * @param questionEncodedKey corresponding question's encoded key
     */
    void posInnertReply(String reply, String parentReplyKey, String questionEncodedKey, AsyncCallback async);
}
